<template>
  <div class="block">

    <el-date-picker
        v-model="value1"
        type="datetimerange"
        range-separator="To"
        :start-placeholder="date1"
        :end-placeholder="date2"
        :default-time="defaultTime1"
        @change="testTime"
    />
  </div>
</template>
<script>
export default {
  data(){
    return {
      value1:Date,
      date1:'开始时间',
      date2:'结束时间',
      value:[],
    }
  },
  methods:{
    testTime:function (){
      this.value[0]=this.date1
      this.value[1]=this.date2
      this.$emit("sentTime",this.value1)

    }
  }

}
</script>

<style scoped>
.block{
  padding: 30px 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  flex: 1;
}
.block:last-child {
  border-right: none;
}
.block .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
</style>